#ifndef _OI_LT360BASE_SURFACEDATABASE_HPP_
#define _OI_LT360BASE_SURFACEDATABASE_HPP_

#include "OiLT360Base.hpp"

namespace Oi
{
    namespace Appl
    {
        struct Flaw
        {
            Core::PointMapPtr pointmap;
            QString zone;
            float width;
            float height;
            float widthThreshold;
            float heightThreshold;
            QDateTime timestamp;
        };

        class OI_LT360BASE_API SurfaceDatabase : public QObject
        {
            Q_OBJECT
        public:
            SurfaceDatabase(QObject* parent, QString path, QString templateName);

        public:
            ~SurfaceDatabase();

        public:
            void addItem(const QDateTime& timestamp, const Core::PointMapPtr& pointmap, const Math::Point3f& peak, float width, float height, const QString& zone);
            void deleteItem(const QDateTime& timestamp);
            QList<Flaw> getItemsByTimestamp();
            QList<Flaw> getItemsByZone();

        private:
            OI_DISABLE_COPY(SurfaceDatabase);
            OI_DECLARE_IMPL(SurfaceDatabase);
        };
    }
}

#endif